package com.nian.mongodb.service.model;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.List;

/**
 * 用途：公司类
 * 开发：zhangmj
 * 日期：2020/4/12 18:29
 */
@Data
@Document(collection = "company")
public class Company implements Serializable {

    @Id
    private String id;
    /**
     * 名称
     */
    private String name;
    /**
     * 代码
     */
    private String code;
    /**
     * 备注
     */
    private String remark;

    @DBRef
    List<Department> departmentList;


    public Company() { }

    public Company(String id, String name, String code, String remark) {
        this.id = id;
        this.name = name;
        this.code = code;
        this.remark = remark;
    }
}


